package Selenium;

import Utils.CommonValue;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

import java.sql.Driver;
import java.util.List;

/**
 * created by zhangyuhang on 2018/7/12
 */
public class selenium1 {

    public static void main(String args[]){
        WebDriver driver = new ChromeDriver();
        driver.get(CommonValue.imooc_login_url);
        driver.findElement(By.tagName("input")).sendKeys(CommonValue.imooc_login_id);
        driver.findElement(By.name("password")).sendKeys(CommonValue.imooc_login_pass);
        driver.findElement(By.className("moco-btn-red")).click();
        //窗口最大化
        driver.manage().window().maximize();
        driver.get("http://www.imooc.com");
        driver.findElement(By.className("search-input")).click();
        driver.findElement(By.className("search-input")).sendKeys("sss");
        WebElement element=driver.findElement(By.className("nav-item"));
        List<WebElement> list=  element.findElements(By.tagName("li"));
        list.get(3).click();


    }
}
